{include file="public/header" /}
{load href="__PLUGINS__iCheck/icheck.min.js"}
{load href="__PLUGINS__iCheck/custom.css"}
    {load href="__CSS__video-js.min.css"}
    {load href="__JS__video.min.js"}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <form class="form-horizontal" method="post">
            <div class="form-group">
                <label class="col-sm-2 control-label">用户id：</label>
                <div class="col-sm-9">
                    <input name="user_id" type="number" class="form-control" value="{present name='name'}{$name.user_id}{/present}">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">内容：</label>
                <div class="col-sm-9">
                    <input name="content" type="text" class="form-control" value="{present name='name'}{$name.content}{/present}">
                </div>
            </div>


            <div class="form-group">
                <label class="col-sm-2 control-label">图片：</label>
                <div class="col-sm-9">
                    <div id="demo"></div>
                </div>
            </div>

            <input name="images" id="images" type="hidden" class="form-control" value="">

            <style type="text/css">
                .meiyouuimmag{
                    margin-bottom: 20px;
                    height:284px;
                    overflow: hidden;
                }
                .meiyouuimmag div{
                    width: 100%;
                    margin-bottom: 10px;
                    overflow:hidden;
                    height: 200px
                }
                .meiyouuimmag div img{
                    width: 100%
                }
                .meiyouuimmag button{
                    position: absolute;
                    right: 15px;
                    display: block;
                }
                #imagasdasd{
                    margin-left: 100px;
                    margin-right: 100px;
                }
            </style>

            <div class="form-group" id="imagasdasd">
                {present name="$name"}
                {if condition="$name.images"}
                {php}$imagesdata = json_decode($name['images'],TRUE);$k=0;{/php}
                {foreach $imagesdata as $v}
                <div class="col-md-3 col-sm-4 col-xs-6 meiyouuimmag" id="id{$k}">
                    <button type="button" class="btn btn btn-sm btn-danger" onclick="delImg({$k})">删除</button>
                    <div class="im"><img src="__ROOT__{$v}" >  </div>
                    <textarea data-img="{$v}" style="resize:none" class="form-control" rows="3"></textarea>
                </div>
                <?php $k++;?>
                {/foreach}
                {/if}
                {/present}
            </div>

            <!-- 引用控制层插件样式 -->
            {load href="__PLUGINS__zyUpload/zyUpload.css"}
            <!-- 引用核心层插件 -->
            {load href="__PLUGINS__zyUpload/zyUpload.js"}
            <!-- 引用初始化JS -->
            <script type="text/javascript">var urlupload='{:url('index/uploads')}'; var root = '__ROOT__'</script>
            {load href="__PLUGINS__zyUpload/script.js"}

    </div>
</div>
</div>
</div>
</form>
</div>
</div>
{include file="public/footer" /}
<script type="text/javascript">

    layui.use(['laydate'], function(){
        var laydate = layui.laydate;
        var form = layui.form;

        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
            ,trigger: 'click'
        });
    })


    $(document).ready(function(){
        $(".i-checks").iCheck({
            checkboxClass: "icheckbox_square-green",
            radioClass: "iradio_square-green",
        })
    });
    function msg(){
        layer.msg("上传成功")
    }
    function time(){
        laydate(
            {
                fixed: false,
                istime: true,
                format: 'YYYY-MM-DD hh:mm:ss',
                zIndex: 999999999999,
                isclear: false,
            }
        )
    }
    function delImg(id){
        $('#id'+id).remove();
    }


</script>
{include file="public/bottom" /}

